<?php

/**
 * alumnoCohorteUnidadFormacion form base class.
 *
 * @method alumnoCohorteUnidadFormacion getObject() Returns the current form's model object
 *
 * @package    sistema_itec_new
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasealumnoCohorteUnidadFormacionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                          => new sfWidgetFormInputHidden(),
      'fecha_ingreso'               => new sfWidgetFormDate(),
      'folio'                       => new sfWidgetFormInputText(),
      'motivo_eleccion'             => new sfWidgetFormInputText(),
      'observaciones'               => new sfWidgetFormInputText(),
      'alumno_id'                   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Alumno'), 'add_empty' => false)),
      'cohorte_unidad_formacion_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CohorteUnidadFormacion'), 'add_empty' => false)),
      'libro_matriz_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('LibroMatriz'), 'add_empty' => true)),
      'estado_id'                   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Estado'), 'add_empty' => false)),
      'turno_id'                    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Turno'), 'add_empty' => false)),
      'accion_comunicacional_id'    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('AccionComunicacional'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'                          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'fecha_ingreso'               => new sfValidatorDate(array('required' => false)),
      'folio'                       => new sfValidatorString(array('max_length' => 5, 'required' => false)),
      'motivo_eleccion'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'observaciones'               => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'alumno_id'                   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Alumno'))),
      'cohorte_unidad_formacion_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('CohorteUnidadFormacion'))),
      'libro_matriz_id'             => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('LibroMatriz'), 'required' => false)),
      'estado_id'                   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Estado'))),
      'turno_id'                    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Turno'))),
      'accion_comunicacional_id'    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('AccionComunicacional'))),
    ));

    $this->widgetSchema->setNameFormat('alumno_cohorte_unidad_formacion[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'alumnoCohorteUnidadFormacion';
  }

}
